package edu.ubb.scp.model;

import java.lang.reflect.Field;

public class Test implements Model {
	private int TestID;
	private String TestName;
	private String Data;
	private String Answer;

	public Test(String testName, String data, String answer) {
		super();
		TestName = testName;
		Data = data;
		Answer = answer;
	}

	public Test() {

	}

	public int getTestID() {
		return TestID;
	}

	public void setTestID(int testID) {
		TestID = testID;
	}

	public String getTestName() {
		return TestName;
	}

	@Override
	public String toString() {
		return "Test [TestID=" + TestID + ", TestName=" + TestName + ", Data="
				+ Data + ", Answer=" + Answer + "]";
	}

	public void setTestName(String testName) {
		TestName = testName;
	}

	public String getData() {
		return Data;
	}

	public void setData(String data) {
		Data = data;
	}

	public String getAnswer() {
		return Answer;
	}

	public void setAnswer(String answer) {
		Answer = answer;
	}
	
	@Override
	public Field getPrimaryKey() {
		try {
			return Test.class.getDeclaredField("TestID");
		} catch (NoSuchFieldException e) {
			e.printStackTrace();
		} catch (SecurityException e) {
			e.printStackTrace();
		}
		return null;
	}
	
	@Override
	public Field[] getKeys() {
		return new Field[] { getPrimaryKey() };
	}
}
